using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using ActiproSoftware.SyntaxEditor;
using ActiproSoftware.SyntaxEditor.Addons.Xml;
using ComponentFactory.Krypton.Docking;
using ComponentFactory.Krypton.Navigator;
using ComponentFactory.Krypton.Toolkit;
using DukeyCssFetch.api;
using DukeyCssFetch.UI;
using HtmlAgilityPack;
using ICSharpCode.TextEditor;
using ICSharpCode.TextEditor.Actions;
using ICSharpCode.TextEditor.Document;

namespace DukeyCssFetch
{
	// Token: 0x02000030 RID: 48
	public class Editor : KryptonForm
	{
		// Token: 0x060001C6 RID: 454 RVA: 0x00014A68 File Offset: 0x00012C68
		public Editor()
		{
			this.findAndReplaceForm_0 = new FindAndReplaceForm();
			
			this.InitializeComponent();
			this.buttonSpecAny_0.Click += new EventHandler(this.buttonSpecAny_0_Click);
		}

		// Token: 0x060001C8 RID: 456 RVA: 0x00014AC4 File Offset: 0x00012CC4
		public Editor(string filename)
		{
			this.findAndReplaceForm_0 = new FindAndReplaceForm();
			
			this.InitializeComponent();
			this.AddFileToEditor(filename);
		}

		// Token: 0x060001D2 RID: 466 RVA: 0x00015290 File Offset: 0x00013490
		public void AddFileToEditor(string path)
		{
			if (!File.Exists(path))
			{
				MessageBox.Show("该文件已经被移除!");
				return;
			}
			foreach (KryptonPage current in this.docknav.Pages)
			{
				if (string.Equals(current.Tag.ToString(), path))
				{
					this.docknav.SelectedPage = current;
					return;
				}
			}
			KryptonPage kryptonPage = new KryptonPage();
			FileInfo fileInfo = new FileInfo(path);
			string name = fileInfo.Name;
			kryptonPage.Text = name;
			kryptonPage.ToolTipTitle = path;
			kryptonPage.ToolTipBody = path;
			kryptonPage.Tag = path;
			XmlSyntaxLanguage language = new XmlSyntaxLanguage();
			SyntaxEditor syntaxEditor = new SyntaxEditor();
			syntaxEditor.Dock = DockStyle.Fill;
			syntaxEditor.Document.Language = language;
			syntaxEditor.Location = new Point(0, 0);
			syntaxEditor.CurrentLineHighlightingVisible = true;
			XmlSchemaResolver languageData = new XmlSchemaResolver();
			syntaxEditor.Document.LanguageData = languageData;
			syntaxEditor.Document.Outlining.Mode = OutliningMode.Automatic;
			syntaxEditor.LineNumberMarginVisible = true;
			syntaxEditor.WordWrap = WordWrapType.Word;
			kryptonPage.Controls.Add(syntaxEditor);
			ButtonSpecAny buttonSpecAny = new ButtonSpecAny();
			buttonSpecAny.Type = PaletteButtonSpecStyle.Close;
			buttonSpecAny.Click += new EventHandler(this.method_5);
			kryptonPage.ButtonSpecs.AddRange(new ButtonSpecAny[]
			{
				buttonSpecAny
			});
			this.docknav.Pages.AddRange(new KryptonPage[]
			{
				kryptonPage
			});
			this.docknav.SelectedPage = kryptonPage;
			DukeyEncode dukeyEncode = new DukeyEncode();
			Encoding encoding = dukeyEncode.GetEncoding(dukeyEncode.GetEncodingName(new FileInfo(path)));
			syntaxEditor.Document.LoadFile(path, encoding);
			syntaxEditor.Focus();
		}

		// Token: 0x060001E6 RID: 486 RVA: 0x0001568C File Offset: 0x0001388C
		private void btnChange_Click(object sender, EventArgs e)
		{
			TagsFrm tagsFrm = new TagsFrm();
			tagsFrm.Show();
			base.Hide();
		}

		// Token: 0x060001E5 RID: 485 RVA: 0x00015668 File Offset: 0x00013868
		private void btnDesignTag_Click(object sender, EventArgs e)
		{
			TagEditFrm tagEditFrm = new TagEditFrm();
			if (tagEditFrm.ShowDialog() == DialogResult.OK)
			{
				this.method_1();
			}
		}

		// Token: 0x060001D9 RID: 473 RVA: 0x000155E4 File Offset: 0x000137E4
		private void btnFind_Click(object sender, EventArgs e)
		{
			this.method_4();
		}

		// Token: 0x060001D5 RID: 469 RVA: 0x0001549C File Offset: 0x0001369C
		private void btnFont_Click(object sender, EventArgs e)
		{
			SyntaxEditor syntaxEditor = this.method_4();
			if (syntaxEditor != null)
			{
				this.fontDialog_0.Font = syntaxEditor.Font;
				if (this.fontDialog_0.ShowDialog(this) == DialogResult.OK)
				{
					syntaxEditor.Font = this.fontDialog_0.Font;
				}
			}
		}

		// Token: 0x060001CE RID: 462 RVA: 0x00014F84 File Offset: 0x00013184
		private void btnFormatText_Click(object sender, EventArgs e)
		{
			HtmlAgilityPack.HtmlDocument htmlDocument = new HtmlAgilityPack.HtmlDocument();
			htmlDocument.OptionAutoCloseOnEnd = true;
			htmlDocument.LoadHtml(this.method_4().Text);
			string[] array = new string[]
			{
				"img",
				"link",
				"meta",
				"input",
				"br",
				"base",
				"hr",
				"area",
				"basefont",
				"col",
				"embed",
				"frame",
				"param"
			};
			string[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				string str = array2[i];
				HtmlNodeCollection htmlNodeCollection = htmlDocument.DocumentNode.SelectNodes("//" + str);
				if (htmlNodeCollection != null)
				{
					foreach (HtmlNode current in ((IEnumerable<HtmlNode>)htmlNodeCollection))
					{
						string text = "<" + str + " ";
						foreach (HtmlAttribute current2 in ((IEnumerable<HtmlAttribute>)current.Attributes))
						{
							string text2 = text;
							text = string.Concat(new string[]
							{
								text2,
								" ",
								current2.Name,
								"=\"",
								current2.Value,
								"\""
							});
						}
						text += "/>";
						HtmlNode newChild = htmlDocument.CreateTextNode(text);
						current.ParentNode.InsertBefore(newChild, current);
						current.ParentNode.RemoveChild(current);
					}
				}
			}
			StringBuilder stringBuilder = new StringBuilder();
			StringWriter writer = new StringWriter(stringBuilder);
			htmlDocument.Save(writer);
			this.method_4().Text = stringBuilder.ToString();
			this.method_4().Document.Language.FormatDocument(this.method_4().Document);
		}

		// Token: 0x060001D0 RID: 464 RVA: 0x00015208 File Offset: 0x00013408
		private void btnOpenFile_Click(object sender, EventArgs e)
		{
			using (OpenFileDialog openFileDialog = new OpenFileDialog())
			{
				openFileDialog.Filter = "All Files (*.*)|*.*|网页文件|*.html;*.htm|样式文件|*.css|js文件|*.js";
				openFileDialog.FilterIndex = 0;
				if (DialogResult.OK == openFileDialog.ShowDialog())
				{
					this.AddFileToEditor(openFileDialog.FileName);
				}
			}
		}

		// Token: 0x060001D8 RID: 472 RVA: 0x000155DC File Offset: 0x000137DC
		private void btnSaveAs_Click(object sender, EventArgs e)
		{
			this.method_7();
		}

		// Token: 0x060001D6 RID: 470 RVA: 0x000154E4 File Offset: 0x000136E4
		private void btnSave_Click(object sender, EventArgs e)
		{
			SyntaxEditor syntaxEditor = this.method_4();
			if (syntaxEditor != null)
			{
				if (syntaxEditor.Document.Filename != null)
				{
					syntaxEditor.Document.SaveFile(syntaxEditor.Document.Filename, LineTerminator.CarriageReturn);
				}
				else
				{
					this.method_7();
				}
				this.lbltips.Text = "已保存!" + this.docknav.SelectedPage.Text + " " + DateTime.Now.ToString("mm:ss");
			}
		}

		// Token: 0x060001E4 RID: 484 RVA: 0x00015644 File Offset: 0x00013844
		private void btnSettings_Click(object sender, EventArgs e)
		{
			TagsFrmSetting tagsFrmSetting = new TagsFrmSetting();
			if (tagsFrmSetting.ShowDialog() == DialogResult.OK)
			{
				this.method_1();
			}
		}

		// Token: 0x060001C7 RID: 455 RVA: 0x00014AA0 File Offset: 0x00012CA0
		private void buttonSpecAny_0_Click(object sender, EventArgs e)
		{
			TagsFrmSetting tagsFrmSetting = new TagsFrmSetting();
			if (tagsFrmSetting.ShowDialog() == DialogResult.OK)
			{
				this.method_1();
			}
		}

		// Token: 0x060001E7 RID: 487 RVA: 0x000156AC File Offset: 0x000138AC
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.icontainer_0 != null)
			{
				this.icontainer_0.Dispose();
			}
			base.Dispose(disposing);
		}

		// Token: 0x060001E3 RID: 483 RVA: 0x00015634 File Offset: 0x00013834
		private void Editor_FormClosed(object sender, FormClosedEventArgs e)
		{
			Comm.showtype = 1;
			Comm.SaveConfig();
		}

		// Token: 0x060001CD RID: 461 RVA: 0x00014F7C File Offset: 0x0001317C
		private void Editor_Load(object sender, EventArgs e)
		{
			this.method_1();
		}

		// Token: 0x060001E8 RID: 488 RVA: 0x000156CC File Offset: 0x000138CC
		private void InitializeComponent()
		{
			this.icontainer_0 = new Container();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(Editor));
			this.kryptonSplitContainer1 = new KryptonSplitContainer();
			this.headerGroup1 = new KryptonHeaderGroup();
			this.buttonSpecHeaderGroup_0 = new ButtonSpecHeaderGroup();
			this.splitContainer1 = new SplitContainer();
			this.webBrowser1 = new WebBrowser();
			this.lbltips = new Label();
			this.btnOpenFile = new KryptonButton();
			this.btnChange = new KryptonButton();
			this.btnDesignTag = new KryptonButton();
			this.btnSettings = new KryptonButton();
			this.btnFind = new KryptonButton();
			this.btnFont = new KryptonButton();
			this.btnFormatText = new KryptonButton();
			this.btnSaveAs = new KryptonButton();
			this.btnSave = new KryptonButton();
			this.docknav = new KryptonDockableNavigator();
			this.txtTagSearch = new KryptonTextBox();
			this.kryptonButton2 = new KryptonButton();
			this.menutab = new ContextMenuStrip(this.icontainer_0);
			this.保存SToolStripMenuItem = new ToolStripMenuItem();
			this.关闭ToolStripMenuItem = new ToolStripMenuItem();
			this.除此之外全部关闭ToolStripMenuItem = new ToolStripMenuItem();
			this.复制完整路径ToolStripMenuItem = new ToolStripMenuItem();
			this.打开所在文件夹OToolStripMenuItem = new ToolStripMenuItem();
			this.fontDialog_0 = new FontDialog();
			this.buttonSpecAny_0 = new ButtonSpecAny();
			this.toolStripContainer1 = new ToolStripContainer();
			this.menuStrip1 = new MenuStrip();
			this.文件ToolStripMenuItem = new ToolStripMenuItem();
			this.新建NToolStripMenuItem = new ToolStripMenuItem();
			this.tfxJyrlgt1 = new ToolStripMenuItem();
			this.最近的文件FToolStripMenuItem = new ToolStripMenuItem();
			this.退出XToolStripMenuItem = new ToolStripMenuItem();
			this.编辑EToolStripMenuItem = new ToolStripMenuItem();
			this.撤销UToolStripMenuItem = new ToolStripMenuItem();
			this.重复RToolStripMenuItem = new ToolStripMenuItem();
			this.查找和替换FToolStripMenuItem = new ToolStripMenuItem();
			this.快速查找FToolStripMenuItem = new ToolStripMenuItem();
			this.快速替换HToolStripMenuItem = new ToolStripMenuItem();
			this.视图VToolStripMenuItem = new ToolStripMenuItem();
			this.字体FToolStripMenuItem = new ToolStripMenuItem();
			this.格式化文档ToolStripMenuItem = new ToolStripMenuItem();
			this.帮助HToolStripMenuItem = new ToolStripMenuItem();
			this.关于ToolStripMenuItem = new ToolStripMenuItem();
			this.kryptonManager_0 = new KryptonManager(this.icontainer_0);
			this.toolTip_0 = new ToolTip(this.icontainer_0);
			((ISupportInitialize)this.kryptonSplitContainer1).BeginInit();
			((ISupportInitialize)this.kryptonSplitContainer1.Panel1).BeginInit();
			this.kryptonSplitContainer1.Panel1.SuspendLayout();
			((ISupportInitialize)this.kryptonSplitContainer1.Panel2).BeginInit();
			this.kryptonSplitContainer1.Panel2.SuspendLayout();
			this.kryptonSplitContainer1.SuspendLayout();
			((ISupportInitialize)this.headerGroup1).BeginInit();
			((ISupportInitialize)this.headerGroup1.Panel).BeginInit();
			this.headerGroup1.SuspendLayout();
			this.splitContainer1.Panel1.SuspendLayout();
			this.splitContainer1.Panel2.SuspendLayout();
			this.splitContainer1.SuspendLayout();
			((ISupportInitialize)this.docknav).BeginInit();
			this.docknav.SuspendLayout();
			this.menutab.SuspendLayout();
			this.toolStripContainer1.ContentPanel.SuspendLayout();
			this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
			this.toolStripContainer1.SuspendLayout();
			this.menuStrip1.SuspendLayout();
			base.SuspendLayout();
			this.kryptonSplitContainer1.Cursor = Cursors.Default;
			this.kryptonSplitContainer1.Dock = DockStyle.Bottom;
			this.kryptonSplitContainer1.FixedPanel = FixedPanel.Panel1;
			this.kryptonSplitContainer1.Location = new Point(0, 0);
			this.kryptonSplitContainer1.Name = "kryptonSplitContainer1";
			this.kryptonSplitContainer1.Panel1.AutoScroll = true;
			this.kryptonSplitContainer1.Panel1.Controls.Add(this.headerGroup1);
			this.kryptonSplitContainer1.Panel1MinSize = 200;
			this.kryptonSplitContainer1.Panel2.Controls.Add(this.splitContainer1);
			this.kryptonSplitContainer1.Size = new Size(1184, 662);
			this.kryptonSplitContainer1.SplitterDistance = 200;
			this.kryptonSplitContainer1.TabIndex = 0;
			this.headerGroup1.AccessibleName = "";
			this.headerGroup1.AutoSize = true;
			this.headerGroup1.ButtonSpecs.AddRange(new ButtonSpecHeaderGroup[]
			{
				this.buttonSpecHeaderGroup_0
			});
			this.headerGroup1.Dock = DockStyle.Top;
			this.headerGroup1.HeaderPositionSecondary = VisualOrientation.Top;
			this.headerGroup1.HeaderStylePrimary = HeaderStyle.Secondary;
			this.headerGroup1.HeaderVisibleSecondary = false;
			this.headerGroup1.Location = new Point(0, 0);
			this.headerGroup1.Name = "headerGroup1";
			this.headerGroup1.Size = new Size(200, 22);
			this.headerGroup1.StateNormal.HeaderPrimary.Content.ShortText.Font = new Font("微软雅黑", 9f, FontStyle.Regular, GraphicsUnit.Point, 134);
			this.headerGroup1.TabIndex = 0;
			this.headerGroup1.ValuesPrimary.Heading = "常用标签";
			this.headerGroup1.ValuesPrimary.Image = null;
			this.headerGroup1.ValuesSecondary.Heading = "标签搜索";
			this.buttonSpecHeaderGroup_0.Type = PaletteButtonSpecStyle.ArrowUp;
			this.buttonSpecHeaderGroup_0.UniqueName = "6045113297B84B1987B6293076DDFD83";
			this.splitContainer1.Dock = DockStyle.Fill;
			this.splitContainer1.IsSplitterFixed = true;
			this.splitContainer1.Location = new Point(0, 0);
			this.splitContainer1.Name = "splitContainer1";
			this.splitContainer1.Orientation = Orientation.Horizontal;
			this.splitContainer1.Panel1.Controls.Add(this.webBrowser1);
			this.splitContainer1.Panel1.Controls.Add(this.lbltips);
			this.splitContainer1.Panel1.Controls.Add(this.btnOpenFile);
			this.splitContainer1.Panel1.Controls.Add(this.btnChange);
			this.splitContainer1.Panel1.Controls.Add(this.btnDesignTag);
			this.splitContainer1.Panel1.Controls.Add(this.btnSettings);
			this.splitContainer1.Panel1.Controls.Add(this.btnFind);
			this.splitContainer1.Panel1.Controls.Add(this.btnFont);
			this.splitContainer1.Panel1.Controls.Add(this.btnFormatText);
			this.splitContainer1.Panel1.Controls.Add(this.btnSaveAs);
			this.splitContainer1.Panel1.Controls.Add(this.btnSave);
			this.splitContainer1.Panel2.Controls.Add(this.docknav);
			this.splitContainer1.Size = new Size(979, 662);
			this.splitContainer1.SplitterDistance = 60;
			this.splitContainer1.TabIndex = 2;
			this.webBrowser1.Location = new Point(916, 17);
			this.webBrowser1.MinimumSize = new Size(20, 20);
			this.webBrowser1.Name = "webBrowser1";
			this.webBrowser1.Size = new Size(27, 20);
			this.webBrowser1.TabIndex = 3;
			this.webBrowser1.Url = new Uri("http://www.mou18.com/dukeysoft/taghelper/tj.html?v=2.7", UriKind.Absolute);
			this.webBrowser1.Visible = false;
			this.lbltips.AutoSize = true;
			this.lbltips.ForeColor = Color.Red;
			this.lbltips.Location = new Point(767, 17);
			this.lbltips.Name = "lbltips";
			this.lbltips.Size = new Size(0, 12);
			this.lbltips.TabIndex = 2;
			this.btnOpenFile.Location = new Point(15, 8);
			this.btnOpenFile.Name = "btnOpenFile";
			this.btnOpenFile.Size = new Size(75, 25);
			this.btnOpenFile.TabIndex = 1;
			this.btnOpenFile.Values.Text = "打开文件";
			this.btnOpenFile.Click += new EventHandler(this.btnOpenFile_Click);
			this.btnChange.Location = new Point(624, 8);
			this.btnChange.Name = "btnChange";
			this.btnChange.Size = new Size(75, 25);
			this.btnChange.TabIndex = 1;
			this.btnChange.Values.Text = "切换模式";
			this.btnChange.Click += new EventHandler(this.btnChange_Click);
			this.btnDesignTag.Location = new Point(537, 8);
			this.btnDesignTag.Name = "btnDesignTag";
			this.btnDesignTag.Size = new Size(75, 25);
			this.btnDesignTag.TabIndex = 1;
			this.btnDesignTag.Values.Text = "标签设计器";
			this.btnDesignTag.Click += new EventHandler(this.btnDesignTag_Click);
			this.btnSettings.Location = new Point(450, 8);
			this.btnSettings.Name = "btnSettings";
			this.btnSettings.Size = new Size(75, 25);
			this.btnSettings.TabIndex = 1;
			this.btnSettings.Values.Text = "设置";
			this.btnSettings.Click += new EventHandler(this.btnSettings_Click);
			this.btnFind.Location = new Point(363, 8);
			this.btnFind.Name = "btnFind";
			this.btnFind.Size = new Size(75, 25);
			this.btnFind.TabIndex = 1;
			this.btnFind.Values.Text = "查找替换";
			this.btnFind.Click += new EventHandler(this.btnFind_Click);
			this.btnFont.Location = new Point(276, 8);
			this.btnFont.Name = "btnFont";
			this.btnFont.Size = new Size(75, 25);
			this.btnFont.TabIndex = 1;
			this.btnFont.Values.Text = "字体";
			this.btnFont.Click += new EventHandler(this.btnFont_Click);
			this.btnFormatText.Location = new Point(713, 8);
			this.btnFormatText.Name = "btnFormatText";
			this.btnFormatText.Size = new Size(90, 25);
			this.btnFormatText.TabIndex = 1;
			this.btnFormatText.Values.Text = "格式化文档";
			this.btnFormatText.Click += new EventHandler(this.btnFormatText_Click);
			this.btnSaveAs.Location = new Point(189, 8);
			this.btnSaveAs.Name = "btnSaveAs";
			this.btnSaveAs.Size = new Size(75, 25);
			this.btnSaveAs.TabIndex = 1;
			this.btnSaveAs.Values.Text = "另存为";
			this.btnSaveAs.Click += new EventHandler(this.btnSaveAs_Click);
			this.btnSave.Location = new Point(102, 8);
			this.btnSave.Name = "btnSave";
			this.btnSave.Size = new Size(75, 25);
			this.btnSave.TabIndex = 1;
			this.btnSave.Values.Text = "保存当前页";
			this.btnSave.Click += new EventHandler(this.btnSave_Click);
			this.docknav.Button.ButtonDisplayLogic = ButtonDisplayLogic.NextPrevious;
			this.docknav.Button.CloseButtonDisplay = ButtonDisplay.Hide;
			this.docknav.Location = new Point(0, 0);
			this.docknav.Name = "docknav";
			this.docknav.Size = new Size(979, 598);
			this.docknav.TabIndex = 0;
			this.docknav.Text = "kryptonDockableNavigator1";
			this.txtTagSearch.Location = new Point(10, 5);
			this.txtTagSearch.Name = "txtTagSearch";
			this.txtTagSearch.Size = new Size(124, 20);
			this.txtTagSearch.TabIndex = 2;
			this.kryptonButton2.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.kryptonButton2.AutoSize = true;
			this.kryptonButton2.Location = new Point(156, 8);
			this.kryptonButton2.Name = "kryptonButton2";
			this.kryptonButton2.Size = new Size(39, 26);
			this.kryptonButton2.TabIndex = 1;
			this.kryptonButton2.Values.Text = "搜 索";
			this.menutab.Font = new Font("Segoe UI", 9f);
			this.menutab.Items.AddRange(new ToolStripItem[]
			{
				this.保存SToolStripMenuItem,
				this.关闭ToolStripMenuItem,
				this.除此之外全部关闭ToolStripMenuItem,
				this.复制完整路径ToolStripMenuItem,
				this.打开所在文件夹OToolStripMenuItem
			});
			this.menutab.Name = "menutab";
			this.menutab.Size = new Size(187, 114);
			this.保存SToolStripMenuItem.Name = "保存SToolStripMenuItem";
			this.保存SToolStripMenuItem.Size = new Size(186, 22);
			this.保存SToolStripMenuItem.Text = "保存(&S)";
			this.关闭ToolStripMenuItem.Name = "关闭ToolStripMenuItem";
			this.关闭ToolStripMenuItem.Size = new Size(186, 22);
			this.关闭ToolStripMenuItem.Text = "关闭(&C)";
			this.除此之外全部关闭ToolStripMenuItem.Name = "除此之外全部关闭ToolStripMenuItem";
			this.除此之外全部关闭ToolStripMenuItem.Size = new Size(186, 22);
			this.除此之外全部关闭ToolStripMenuItem.Text = "除此之外全部关闭(&A)";
			this.复制完整路径ToolStripMenuItem.Name = "复制完整路径ToolStripMenuItem";
			this.复制完整路径ToolStripMenuItem.Size = new Size(186, 22);
			this.复制完整路径ToolStripMenuItem.Text = "复制完整路径(&F)";
			this.打开所在文件夹OToolStripMenuItem.Name = "打开所在文件夹OToolStripMenuItem";
			this.打开所在文件夹OToolStripMenuItem.Size = new Size(186, 22);
			this.打开所在文件夹OToolStripMenuItem.Text = "打开所在文件夹(&O)";
			this.buttonSpecAny_0.Type = PaletteButtonSpecStyle.Context;
			this.buttonSpecAny_0.UniqueName = "F3BFD4B0DBF84EEE138E46E74A38BB26";
			this.toolStripContainer1.BottomToolStripPanelVisible = false;
			this.toolStripContainer1.ContentPanel.Controls.Add(this.kryptonSplitContainer1);
			this.toolStripContainer1.ContentPanel.Size = new Size(1184, 662);
			this.toolStripContainer1.Dock = DockStyle.Fill;
			this.toolStripContainer1.LeftToolStripPanelVisible = false;
			this.toolStripContainer1.Location = new Point(0, 0);
			this.toolStripContainer1.Name = "toolStripContainer1";
			this.toolStripContainer1.RightToolStripPanelVisible = false;
			this.toolStripContainer1.Size = new Size(1184, 662);
			this.toolStripContainer1.TabIndex = 1;
			this.toolStripContainer1.Text = "toolStripContainer1";
			this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.menuStrip1);
			this.menuStrip1.Dock = DockStyle.None;
			this.menuStrip1.Font = new Font("Segoe UI", 9f);
			this.menuStrip1.Items.AddRange(new ToolStripItem[]
			{
				this.文件ToolStripMenuItem,
				this.编辑EToolStripMenuItem,
				this.视图VToolStripMenuItem,
				this.帮助HToolStripMenuItem
			});
			this.menuStrip1.Location = new Point(0, 0);
			this.menuStrip1.Name = "menuStrip1";
			this.menuStrip1.Size = new Size(1184, 24);
			this.menuStrip1.TabIndex = 0;
			this.menuStrip1.Text = "menuStrip1";
			this.menuStrip1.Visible = false;
			this.文件ToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[]
			{
				this.新建NToolStripMenuItem,
				this.tfxJyrlgt1,
				this.最近的文件FToolStripMenuItem,
				this.退出XToolStripMenuItem
			});
			this.文件ToolStripMenuItem.Name = "文件ToolStripMenuItem";
			this.文件ToolStripMenuItem.Size = new Size(57, 20);
			this.文件ToolStripMenuItem.Text = "文件(&F)";
			this.新建NToolStripMenuItem.Name = "新建NToolStripMenuItem";
			this.新建NToolStripMenuItem.Size = new Size(148, 22);
			this.新建NToolStripMenuItem.Text = "新建(&N)";
			this.tfxJyrlgt1.Name = "打开OToolStripMenuItem";
			this.tfxJyrlgt1.Size = new Size(148, 22);
			this.tfxJyrlgt1.Text = "打开(&O)";
			this.最近的文件FToolStripMenuItem.Name = "最近的文件FToolStripMenuItem";
			this.最近的文件FToolStripMenuItem.Size = new Size(148, 22);
			this.最近的文件FToolStripMenuItem.Text = "最近的文件(&F)";
			this.退出XToolStripMenuItem.Name = "退出XToolStripMenuItem";
			this.退出XToolStripMenuItem.Size = new Size(148, 22);
			this.退出XToolStripMenuItem.Text = "退出(&X)";
			this.编辑EToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[]
			{
				this.撤销UToolStripMenuItem,
				this.重复RToolStripMenuItem,
				this.查找和替换FToolStripMenuItem
			});
			this.编辑EToolStripMenuItem.Name = "编辑EToolStripMenuItem";
			this.编辑EToolStripMenuItem.Size = new Size(57, 20);
			this.编辑EToolStripMenuItem.Text = "编辑(E)";
			this.撤销UToolStripMenuItem.Name = "撤销UToolStripMenuItem";
			this.撤销UToolStripMenuItem.Size = new Size(148, 22);
			this.撤销UToolStripMenuItem.Text = "撤销(&U)";
			this.重复RToolStripMenuItem.Name = "重复RToolStripMenuItem";
			this.重复RToolStripMenuItem.Size = new Size(148, 22);
			this.重复RToolStripMenuItem.Text = "重复(&R)";
			this.查找和替换FToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[]
			{
				this.快速查找FToolStripMenuItem,
				this.快速替换HToolStripMenuItem
			});
			this.查找和替换FToolStripMenuItem.Name = "查找和替换FToolStripMenuItem";
			this.查找和替换FToolStripMenuItem.Size = new Size(148, 22);
			this.查找和替换FToolStripMenuItem.Text = "查找和替换(&F)";
			this.快速查找FToolStripMenuItem.Name = "快速查找FToolStripMenuItem";
			this.快速查找FToolStripMenuItem.Size = new Size(139, 22);
			this.快速查找FToolStripMenuItem.Text = "快速查找(&F)";
			this.快速替换HToolStripMenuItem.Name = "快速替换HToolStripMenuItem";
			this.快速替换HToolStripMenuItem.Size = new Size(139, 22);
			this.快速替换HToolStripMenuItem.Text = "快速替换(&H)";
			this.视图VToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[]
			{
				this.字体FToolStripMenuItem,
				this.格式化文档ToolStripMenuItem
			});
			this.视图VToolStripMenuItem.Name = "视图VToolStripMenuItem";
			this.视图VToolStripMenuItem.Size = new Size(60, 20);
			this.视图VToolStripMenuItem.Text = "选项(&O)";
			this.字体FToolStripMenuItem.Name = "字体FToolStripMenuItem";
			this.字体FToolStripMenuItem.Size = new Size(134, 22);
			this.字体FToolStripMenuItem.Text = "字体(&F)";
			this.格式化文档ToolStripMenuItem.Name = "格式化文档ToolStripMenuItem";
			this.格式化文档ToolStripMenuItem.Size = new Size(134, 22);
			this.格式化文档ToolStripMenuItem.Text = "格式化文档";
			this.帮助HToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[]
			{
				this.关于ToolStripMenuItem
			});
			this.帮助HToolStripMenuItem.Name = "帮助HToolStripMenuItem";
			this.帮助HToolStripMenuItem.Size = new Size(60, 20);
			this.帮助HToolStripMenuItem.Text = "帮助(&H)";
			this.关于ToolStripMenuItem.Name = "关于ToolStripMenuItem";
			this.关于ToolStripMenuItem.Size = new Size(98, 22);
			this.关于ToolStripMenuItem.Text = "关于";
			this.kryptonManager_0.GlobalPaletteMode = PaletteModeManager.Office2007Blue;
			this.toolTip_0.AutoPopDelay = 10000;
			this.toolTip_0.InitialDelay = 200;
			this.toolTip_0.ReshowDelay = 100;
			this.toolTip_0.ShowAlways = true;
			base.AllowButtonSpecToolTips = true;
			base.AutoScaleDimensions = new SizeF(6f, 12f);
			base.AutoScaleMode = AutoScaleMode.Font;
			base.ButtonSpecs.AddRange(new ButtonSpecAny[]
			{
				this.buttonSpecAny_0
			});
			base.ClientSize = new Size(1184, 662);
			base.Controls.Add(this.toolStripContainer1);
			base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
			base.MainMenuStrip = this.menuStrip1;
			base.Name = "Editor";
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "都客标签编辑器";
			base.TextExtra = "推荐仿站必备工具,都客仿站高手www.mou18.com";
			base.Load += new EventHandler(this.Editor_Load);
			base.FormClosed += new FormClosedEventHandler(this.Editor_FormClosed);
			((ISupportInitialize)this.kryptonSplitContainer1.Panel1).EndInit();
			this.kryptonSplitContainer1.Panel1.ResumeLayout(false);
			this.kryptonSplitContainer1.Panel1.PerformLayout();
			((ISupportInitialize)this.kryptonSplitContainer1.Panel2).EndInit();
			this.kryptonSplitContainer1.Panel2.ResumeLayout(false);
			((ISupportInitialize)this.kryptonSplitContainer1).EndInit();
			this.kryptonSplitContainer1.ResumeLayout(false);
			((ISupportInitialize)this.headerGroup1.Panel).EndInit();
			((ISupportInitialize)this.headerGroup1).EndInit();
			this.headerGroup1.ResumeLayout(false);
			this.splitContainer1.Panel1.ResumeLayout(false);
			this.splitContainer1.Panel1.PerformLayout();
			this.splitContainer1.Panel2.ResumeLayout(false);
			this.splitContainer1.ResumeLayout(false);
			((ISupportInitialize)this.docknav).EndInit();
			this.docknav.ResumeLayout(false);
			this.menutab.ResumeLayout(false);
			this.toolStripContainer1.ContentPanel.ResumeLayout(false);
			this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);
			this.toolStripContainer1.TopToolStripPanel.PerformLayout();
			this.toolStripContainer1.ResumeLayout(false);
			this.toolStripContainer1.PerformLayout();
			this.menuStrip1.ResumeLayout(false);
			this.menuStrip1.PerformLayout();
			base.ResumeLayout(false);
		}

		// Token: 0x060001C9 RID: 457 RVA: 0x00014AEC File Offset: 0x00012CEC
		private void method_0(TextEditorControl textEditorControl_0, IEditAction ieditAction_0)
		{
			if (textEditorControl_0 != null && ieditAction_0 != null)
			{
				TextArea textArea = textEditorControl_0.ActiveTextAreaControl.TextArea;
				textEditorControl_0.BeginUpdate();
				try
				{
					lock (textEditorControl_0.Document)
					{
						ieditAction_0.Execute(textArea);
						if (textArea.SelectionManager.HasSomethingSelected && textArea.AutoClearSelection && textArea.Document.TextEditorProperties.DocumentSelectionMode == DocumentSelectionMode.Normal)
						{
							textArea.SelectionManager.ClearSelection();
						}
					}
				}
				finally
				{
					textEditorControl_0.EndUpdate();
					textArea.Caret.UpdateCaretPosition();
				}
			}
		}

		// Token: 0x060001CA RID: 458 RVA: 0x00014B90 File Offset: 0x00012D90
		private void method_1()
		{
			try
			{
				this.Text = "都客标签-模板编辑器   当前标签为:" + Comm.CurrentTag;
				this.kryptonSplitContainer1.Panel1.Controls.Clear();
				string xmlFileName = Comm.root + "\\tag\\" + Comm.CurrentTag;
				XmlNode xmlNodeByXpath = XMLHelper.GetXmlNodeByXpath(xmlFileName, "tags");
				XmlNodeList xmlNodeList = xmlNodeByXpath.SelectNodes("group");
				foreach (XmlNode xmlNode in xmlNodeList)
				{
					KryptonHeaderGroup kryptonHeaderGroup = new KryptonHeaderGroup();
					kryptonHeaderGroup.AccessibleName = "";
					kryptonHeaderGroup.AutoSize = true;
					ButtonSpecHeaderGroup buttonSpecHeaderGroup = new ButtonSpecHeaderGroup();
					buttonSpecHeaderGroup.Type = PaletteButtonSpecStyle.ArrowUp;
					kryptonHeaderGroup.ButtonSpecs.AddRange(new ButtonSpecHeaderGroup[]
					{
						buttonSpecHeaderGroup
					});
					kryptonHeaderGroup.Size = new Size(200, 503);
					kryptonHeaderGroup.StateNormal.HeaderPrimary.Content.ShortText.Font = new Font("微软雅黑", 10.5f, FontStyle.Regular, GraphicsUnit.Point, 134);
					kryptonHeaderGroup.Dock = DockStyle.Top;
					kryptonHeaderGroup.HeaderVisibleSecondary = false;
					kryptonHeaderGroup.Location = new Point(0, 2);
					kryptonHeaderGroup.ValuesPrimary.Heading = xmlNode.Attributes["name"].InnerText;
					kryptonHeaderGroup.HeaderStylePrimary = HeaderStyle.Secondary;
					int num = 2;
					foreach (XmlNode xmlNode2 in xmlNode.SelectNodes("tag"))
					{
						KryptonButton kryptonButton = new KryptonButton();
						kryptonButton.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
						kryptonButton.Top = num;
						kryptonButton.Left = 2;
						kryptonButton.Size = new Size(193, 25);
						kryptonButton.Margin = new Padding(20);
						kryptonButton.Text = xmlNode2.Attributes["name"].InnerText;
						kryptonButton.Tag = xmlNode2.SelectSingleNode("value").InnerText;
						this.toolTip_0.SetToolTip(kryptonButton, xmlNode2.SelectSingleNode("tips").InnerText);
						kryptonButton.Tag = xmlNode2.SelectSingleNode("value").InnerText;
						kryptonButton.Click += new EventHandler(this.method_2);
						kryptonHeaderGroup.Panel.Controls.Add(kryptonButton);
						num = num + kryptonButton.Height + 1;
					}
					kryptonHeaderGroup.MouseDown += new MouseEventHandler(this.method_3);
					kryptonHeaderGroup.Collapsed = true;
					kryptonHeaderGroup.AutoCollapseArrow = false;
					kryptonHeaderGroup.AllowButtonSpecToolTips = false;
					this.kryptonSplitContainer1.Panel1.Controls.Add(kryptonHeaderGroup);
				}
			}
			catch (Exception)
			{
			}
		}

		// Token: 0x060001DC RID: 476 RVA: 0x00015600 File Offset: 0x00013800
		private void method_10(object sender, EventArgs e)
		{
		}

		// Token: 0x060001DD RID: 477 RVA: 0x00015604 File Offset: 0x00013804
		private void method_11(object sender, ToolStripDropDownClosedEventArgs e)
		{
		}

		// Token: 0x060001DE RID: 478 RVA: 0x00015608 File Offset: 0x00013808
		private void method_12(object sender, EventArgs e)
		{
		}

		// Token: 0x060001DF RID: 479 RVA: 0x0001560C File Offset: 0x0001380C
		private void method_13(object sender, EventArgs e)
		{
			MessageBox.Show("fdsfs");
		}

		// Token: 0x060001E0 RID: 480 RVA: 0x0001561C File Offset: 0x0001381C
		private void method_14(object sender, EventArgs e)
		{
			MessageBox.Show("ffgdf");
		}

		// Token: 0x060001E1 RID: 481 RVA: 0x0001562C File Offset: 0x0001382C
		private void method_15(object sender, EventArgs e)
		{
		}

		// Token: 0x060001E2 RID: 482 RVA: 0x00015630 File Offset: 0x00013830
		private void method_16(object sender, EventArgs e)
		{
		}

		// Token: 0x060001CB RID: 459 RVA: 0x00014EC8 File Offset: 0x000130C8
		private void method_2(object sender, EventArgs e)
		{
			lock (this)
			{
				if (this.method_4() == null)
				{
					this.lbltips.Text = "请打开文件后再进行此操作!";
				}
				else
				{
					Clipboard.Clear();
					KryptonButton kryptonButton = sender as KryptonButton;
					Clipboard.SetText(kryptonButton.Tag.ToString());
					Clipboard.Clear();
				}
			}
		}

		// Token: 0x060001CC RID: 460 RVA: 0x00014F34 File Offset: 0x00013134
		private void method_3(object sender, MouseEventArgs e)
		{
			KryptonHeaderGroup kryptonHeaderGroup = sender as KryptonHeaderGroup;
			if (kryptonHeaderGroup != null && kryptonHeaderGroup != null)
			{
				kryptonHeaderGroup.Collapsed = !kryptonHeaderGroup.Collapsed;
				kryptonHeaderGroup.ButtonSpecs[0].Type = (kryptonHeaderGroup.Collapsed ? PaletteButtonSpecStyle.ArrowDown : PaletteButtonSpecStyle.ArrowUp);
			}
		}

		// Token: 0x060001CF RID: 463 RVA: 0x000151D4 File Offset: 0x000133D4
		private SyntaxEditor method_4()
		{
			if (this.docknav.Pages.Count == 0)
			{
				return null;
			}
			return this.docknav.SelectedPage.Controls[0] as SyntaxEditor;
		}

		// Token: 0x060001D1 RID: 465 RVA: 0x00015260 File Offset: 0x00013460
		private void method_5(object sender, EventArgs e)
		{
			ButtonSpecAny buttonSpecAny = sender as ButtonSpecAny;
			this.docknav.Pages.Remove(buttonSpecAny.Owner as KryptonPage);
		}

		// Token: 0x060001D3 RID: 467 RVA: 0x00015464 File Offset: 0x00013664
		private void method_6(object sender, EventArgs e)
		{
			throw new NotImplementedException();
		}

		// Token: 0x060001D7 RID: 471 RVA: 0x00015564 File Offset: 0x00013764
		private void method_7()
		{
			SyntaxEditor syntaxEditor = this.method_4();
			if (syntaxEditor != null)
			{
				using (SaveFileDialog saveFileDialog = new SaveFileDialog())
				{
					saveFileDialog.Filter = "All Files (*.*)|*.*|网页文件|*.html;*.htm|样式文件|*.css|js文件|*.js";
					saveFileDialog.FilterIndex = 0;
					if (DialogResult.OK == saveFileDialog.ShowDialog())
					{
						syntaxEditor.Document.SaveFile(saveFileDialog.FileName, LineTerminator.Newline);
						syntaxEditor.Document.Filename = saveFileDialog.FileName;
					}
				}
			}
		}

		// Token: 0x060001DA RID: 474 RVA: 0x000155F8 File Offset: 0x000137F8
		private void method_8(object sender, EventArgs e)
		{
		}

		// Token: 0x060001DB RID: 475 RVA: 0x000155FC File Offset: 0x000137FC
		private void method_9(object sender, EventArgs e)
		{
		}

		// Token: 0x060001D4 RID: 468 RVA: 0x0001546C File Offset: 0x0001366C
		public void UpdateXsdDocumentOutline()
		{
			if (this.method_4().Document.SemanticParseData is ICompilationUnit)
			{
				ICompilationUnit arg_2C_0 = (ICompilationUnit)this.method_4().Document.SemanticParseData;
			}
		}

		// Token: 0x040001F6 RID: 502
		private KryptonButton btnChange;

		// Token: 0x040001F5 RID: 501
		private KryptonButton btnDesignTag;

		// Token: 0x040001CA RID: 458
		private KryptonButton btnFind;

		// Token: 0x040001F1 RID: 497
		private KryptonButton btnFont;

		// Token: 0x040001CD RID: 461
		private KryptonButton btnFormatText;

		// Token: 0x040001CE RID: 462
		private KryptonButton btnOpenFile;

		// Token: 0x040001CC RID: 460
		private KryptonButton btnSave;

		// Token: 0x040001CB RID: 459
		private KryptonButton btnSaveAs;

		// Token: 0x040001F4 RID: 500
		private KryptonButton btnSettings;

		// Token: 0x040001D3 RID: 467
		private ButtonSpecAny buttonSpecAny_0;

		// Token: 0x040001D1 RID: 465
		private ButtonSpecHeaderGroup buttonSpecHeaderGroup_0;

		// Token: 0x040001F2 RID: 498
		private KryptonDockableNavigator docknav;

		// Token: 0x040001C7 RID: 455
		private FindAndReplaceForm findAndReplaceForm_0;

		// Token: 0x040001D2 RID: 466
		private FontDialog fontDialog_0;

		// Token: 0x040001D0 RID: 464
		private KryptonHeaderGroup headerGroup1;

		// Token: 0x040001C8 RID: 456
		private IContainer icontainer_0;

		// Token: 0x040001E9 RID: 489
		private KryptonButton kryptonButton2;

		// Token: 0x040001E6 RID: 486
		private KryptonManager kryptonManager_0;

		// Token: 0x040001C9 RID: 457
		private KryptonSplitContainer kryptonSplitContainer1;

		// Token: 0x040001F0 RID: 496
		private Label lbltips;

		// Token: 0x040001D5 RID: 469
		private MenuStrip menuStrip1;

		// Token: 0x040001EA RID: 490
		private ContextMenuStrip menutab;

		// Token: 0x040001CF RID: 463
		private SplitContainer splitContainer1;

		// Token: 0x040001DA RID: 474
		private ToolStripMenuItem tfxJyrlgt1;

		// Token: 0x040001D4 RID: 468
		private ToolStripContainer toolStripContainer1;

		// Token: 0x040001E7 RID: 487
		private ToolTip toolTip_0;

		// Token: 0x040001E8 RID: 488
		private KryptonTextBox txtTagSearch;

		// Token: 0x040001F3 RID: 499
		private WebBrowser webBrowser1;

		// Token: 0x040001EB RID: 491
		private ToolStripMenuItem 保存SToolStripMenuItem;

		// Token: 0x040001E5 RID: 485
		private ToolStripMenuItem 关于ToolStripMenuItem;

		// Token: 0x040001EC RID: 492
		private ToolStripMenuItem 关闭ToolStripMenuItem;

		// Token: 0x040001EE RID: 494
		private ToolStripMenuItem 复制完整路径ToolStripMenuItem;

		// Token: 0x040001E3 RID: 483
		private ToolStripMenuItem 字体FToolStripMenuItem;

		// Token: 0x040001E0 RID: 480
		private ToolStripMenuItem 帮助HToolStripMenuItem;

		// Token: 0x040001E2 RID: 482
		private ToolStripMenuItem 快速替换HToolStripMenuItem;

		// Token: 0x040001E1 RID: 481
		private ToolStripMenuItem 快速查找FToolStripMenuItem;

		// Token: 0x040001EF RID: 495
		private ToolStripMenuItem 打开所在文件夹OToolStripMenuItem;

		// Token: 0x040001DD RID: 477
		private ToolStripMenuItem 撤销UToolStripMenuItem;

		// Token: 0x040001D6 RID: 470
		private ToolStripMenuItem 文件ToolStripMenuItem;

		// Token: 0x040001D9 RID: 473
		private ToolStripMenuItem 新建NToolStripMenuItem;

		// Token: 0x040001DB RID: 475
		private ToolStripMenuItem 最近的文件FToolStripMenuItem;

		// Token: 0x040001DF RID: 479
		private ToolStripMenuItem 查找和替换FToolStripMenuItem;

		// Token: 0x040001E4 RID: 484
		private ToolStripMenuItem 格式化文档ToolStripMenuItem;

		// Token: 0x040001D7 RID: 471
		private ToolStripMenuItem 编辑EToolStripMenuItem;

		// Token: 0x040001D8 RID: 472
		private ToolStripMenuItem 视图VToolStripMenuItem;

		// Token: 0x040001DC RID: 476
		private ToolStripMenuItem 退出XToolStripMenuItem;

		// Token: 0x040001DE RID: 478
		private ToolStripMenuItem 重复RToolStripMenuItem;

		// Token: 0x040001ED RID: 493
		private ToolStripMenuItem 除此之外全部关闭ToolStripMenuItem;
	}
}
